package org.eclipselabs.egf.portfolio.task.scala.test.date

import org.eclipse.core.runtime.IProgressMonitor
import org.eclipse.egf.core.EGFCorePlugin
import org.eclipse.egf.core.producer.InvocationException
import org.eclipse.egf.ftask.producer.context.ITaskProductionContext
import org.eclipse.egf.ftask.producer.invocation.ITaskProduction
import java.util.Date
import java.text.DateFormat

class ShowDate extends ITaskProduction{
	
	def preExecute(taskProductionContext:ITaskProductionContext , monitor:IProgressMonitor ) ={
	}
	
	def doExecute(taskProductionContext:ITaskProductionContext , monitor:IProgressMonitor )={
		var inDate = taskProductionContext.getInputValue("inDate", classOf[Date])
		EGFCorePlugin.getDefault().logInfo("date : " + DateFormat.getDateInstance().format(inDate))
		EGFCorePlugin.getDefault().logInfo("day : " + inDate.getDate())
		EGFCorePlugin.getDefault().logInfo("month : " + inDate.getMonth())
		EGFCorePlugin.getDefault().logInfo("year : " + inDate.getYear())
		EGFCorePlugin.getDefault().logInfo("hour : " + inDate.getHours())
		
	}
	
	def postExecute(taskProductionContext:ITaskProductionContext , monitor:IProgressMonitor )={
	}
}